function [ BB ] = calc_bb( theta, lambda, N )
% Calculates the matrix B'
d = lambda / 2;
phi = (1i*2*pi*d*sind(theta))/lambda;
dphi = (1i*2*pi*d*cosd(theta))/lambda;
n =  transpose(linspace(0,N - 1, N));
BB = zeros(N);
for a=1:N
   for b=1:N
       BB(a,b) = (n(a)-n(b))*dphi*exp((n(a)-n(b))*phi);
   end
end

end

